package com.denso.store.main;

import com.denso.store.common.model.Archive;
import com.denso.store.common.model.Scheduler;
import com.xiaoleilu.hutool.util.BeanUtil;

import java.beans.PropertyDescriptor;
import java.util.Date;
import java.util.Map;

/**
 * Created by lijian on 2017/10/23.
 */
public class Test {

    public static void main(String[] args) {
        Scheduler scheduler = new Scheduler();
        scheduler.setId(1);
        scheduler.setCompany("TEST");
        scheduler.setPlanTime(new Date());
        Map beanMap = BeanUtil.beanToMap(scheduler);
        System.out.println(scheduler);

        Archive archive = new Archive();
        try {
            PropertyDescriptor[] test = BeanUtil.getPropertyDescriptors(Archive.class);
            System.out.println(test.length);
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        System.out.println(BeanUtil.isBean(Archive.class));
        BeanUtil.fillBeanWithMap(beanMap, archive, true);
        System.out.println(archive);
    }
}
